yjx.controller('userController',['$rootScope','$scope','$timeout','$fetch','modalService','wxShareService','$init','ipCookie',function($rootScope,$scope,$timeout,$fetch,modalService,wxShareService,$init,ipCookie){
    $scope.summary="这个人很懒，什么也没留下...";
    $init.title("个人中心")
   
    $rootScope.userId= $rootScope.userId?$rootScope.userId:ipCookie('userId')
    $scope.invite = function () {
        modalService.mainMsgInfo("点击右上角将邀请链接转发给客户");
    }
    if(ipCookie('token')){
        var wxDesc = '邀请您注册基因团的健康管家';
        $scope.link = APPSRC+'#/?inviteId='+$rootScope.userId;
        wxShareService.onHideMenuItems();
        wxShareService.onMenuShareAppMessage('',wxDesc,'',$scope.link,'')
    }

     /**获取统计数据 */
     
     function getSumInfo() {
        $fetch.fetch(
            '/home/me/reportInfo',
            {
                cache: false
            }
        ).then(function (data) {
            $timeout(function () {
                $rootScope.mbrokerage = data.accumulativeBrokerage;
                $rootScope.mbrokerage1 = data.alsoCanGetBrokerage;
                $rootScope.myClients = data.customerCount;
            })
        })
    }
    if($rootScope.identity==1){
        getSumInfo();
     }

}])